"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
import requests
from utils.logger import logger


class BaseApi:

    def send_api(self, req):
        '''
        完成底层接口请求工具的封装
        '''
        '''
        req = {
            "method": "get",
            "url": "xxxx",
            "params": {},
            "json": {}
        }
        '''
        # **req 等同于 requests.request(method="get", url="xxxx", params={}, json={})
        logger.info(f"请求数据为 ======> {req}")
        r = requests.request(**req)
        logger.info(f"响应数据为 ------> {r.text}")
        return r